<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OpenIG: OpenIG::Base::IDPool Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="openig_logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">OpenIG
   &#160;<span id="projectnumber">2.0.7</span>
   </div>
   <div id="projectbrief">cross-platform open-source OpenSceneGraph Image Generator</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>OpenIG</b></li><li class="navelem"><b>Base</b></li><li class="navelem"><a class="el" href="class_open_i_g_1_1_base_1_1_i_d_pool.html">IDPool</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pro-types">Protected Types</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="class_open_i_g_1_1_base_1_1_i_d_pool-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">OpenIG::Base::IDPool Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Handy singleton class for ID numbers management.  
 <a href="class_open_i_g_1_1_base_1_1_i_d_pool.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_i_d_pool_8h_source.html">IDPool.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_open_i_g_1_1_base_1_1_i_d_pool_1_1_id_group.html">IdGroup</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">The <a class="el" href="struct_open_i_g_1_1_base_1_1_i_d_pool_1_1_id_group.html" title="The IdGroup struct. Internal for ID management. ">IdGroup</a> struct. Internal for ID management.  <a href="struct_open_i_g_1_1_base_1_1_i_d_pool_1_1_id_group.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:af2e9335fefca0c78fd13f65af9fee2b3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_open_i_g_1_1_base_1_1_i_d_pool.html#af2e9335fefca0c78fd13f65af9fee2b3">initIdGroup</a> (const std::string &amp;group, unsigned int base, unsigned int size=0)</td></tr>
<tr class="memdesc:af2e9335fefca0c78fd13f65af9fee2b3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Inits a ID group by a name, base ID and the size of this group.  <a href="#af2e9335fefca0c78fd13f65af9fee2b3">More...</a><br /></td></tr>
<tr class="separator:af2e9335fefca0c78fd13f65af9fee2b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa0af72dbedf8790864c17fcd642404ff"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_open_i_g_1_1_base_1_1_i_d_pool.html#aa0af72dbedf8790864c17fcd642404ff">getNextId</a> (const std::string &amp;group, unsigned int &amp;id)</td></tr>
<tr class="memdesc:aa0af72dbedf8790864c17fcd642404ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the next ID from a ID group.  <a href="#aa0af72dbedf8790864c17fcd642404ff">More...</a><br /></td></tr>
<tr class="separator:aa0af72dbedf8790864c17fcd642404ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4680b1c9d32f9d5363315ea000f4ab17"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_open_i_g_1_1_base_1_1_i_d_pool.html#a4680b1c9d32f9d5363315ea000f4ab17">setAvailableIds</a> (const std::string &amp;group, const std::vector&lt; unsigned int &gt; &amp;ids)</td></tr>
<tr class="memdesc:a4680b1c9d32f9d5363315ea000f4ab17"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets list of IDs to be reused.  <a href="#a4680b1c9d32f9d5363315ea000f4ab17">More...</a><br /></td></tr>
<tr class="separator:a4680b1c9d32f9d5363315ea000f4ab17"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a01a4e5ea2d56c5d0c4ea2fd019a3cbc6"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="class_open_i_g_1_1_base_1_1_i_d_pool.html">IDPool</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_open_i_g_1_1_base_1_1_i_d_pool.html#a01a4e5ea2d56c5d0c4ea2fd019a3cbc6">instance</a> ()</td></tr>
<tr class="memdesc:a01a4e5ea2d56c5d0c4ea2fd019a3cbc6"><td class="mdescLeft">&#160;</td><td class="mdescRight">The singleton.  <a href="#a01a4e5ea2d56c5d0c4ea2fd019a3cbc6">More...</a><br /></td></tr>
<tr class="separator:a01a4e5ea2d56c5d0c4ea2fd019a3cbc6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-types"></a>
Protected Types</h2></td></tr>
<tr class="memitem:a7329a97d411dae474e4e6ec511ff7305"><td class="memItemLeft" align="right" valign="top"><a id="a7329a97d411dae474e4e6ec511ff7305"></a>
typedef std::map&lt; std::string, <a class="el" href="struct_open_i_g_1_1_base_1_1_i_d_pool_1_1_id_group.html">IdGroup</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>IdGroupMap</b></td></tr>
<tr class="separator:a7329a97d411dae474e4e6ec511ff7305"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:aa3b9e06cb26f8d05a390cc38fccebca5"><td class="memItemLeft" align="right" valign="top"><a id="aa3b9e06cb26f8d05a390cc38fccebca5"></a>
IdGroupMap&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_open_i_g_1_1_base_1_1_i_d_pool.html#aa3b9e06cb26f8d05a390cc38fccebca5">_groups</a></td></tr>
<tr class="memdesc:aa3b9e06cb26f8d05a390cc38fccebca5"><td class="mdescLeft">&#160;</td><td class="mdescRight">name based std::map of <a class="el" href="struct_open_i_g_1_1_base_1_1_i_d_pool_1_1_id_group.html">IdGroup</a> <br /></td></tr>
<tr class="separator:aa3b9e06cb26f8d05a390cc38fccebca5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Handy singleton class for ID numbers management. </p>
<p>The inherits of <a class="el" href="class_open_i_g_1_1_base_1_1_image_generator.html">OpenIG::Base::ImageGenerator</a> are exepcted to implement ID based scene management of <a class="el" href="class_open_i_g_1_1_base_1_1_image_generator.html#a32c1e1a62540af3ba83afe4ab0340ad6">OpenIG::Base::ImageGenerator::Entity</a>, Lights .. etc. There are situation when one will need an automated ID generations, for example when reading a model definition from a file containing ID based constructs like Lights. As a reference see the ModelCompositionPlugin and LightingPlugin implementations/ </p><dl class="section author"><dt>Author</dt><dd>Trajce Nikolov Nick <a href="#" onclick="location.href='mai'+'lto:'+'ope'+'ni'+'g@c'+'om'+'pro'+'.n'+'et'; return false;">openi<span style="display: none;">.nosp@m.</span>g@co<span style="display: none;">.nosp@m.</span>mpro.<span style="display: none;">.nosp@m.</span>net</a> </dd></dl>
<dl class="section copyright"><dt>Copyright</dt><dd>(c)Compro Computer Services, Inc. </dd></dl>
<dl class="section date"><dt>Date</dt><dd>Sun Jan 11 2015 </dd></dl>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="aa0af72dbedf8790864c17fcd642404ff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa0af72dbedf8790864c17fcd642404ff">&#9670;&nbsp;</a></span>getNextId()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool OpenIG::Base::IDPool::getNextId </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>group</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int &amp;&#160;</td>
          <td class="paramname"><em>id</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the next ID from a ID group. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">The</td><td>name of the group ID </td></tr>
    <tr><td class="paramname">The</td><td>next ID available </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true on success, false if no more available IDs </dd></dl>
<dl class="section author"><dt>Author</dt><dd>Trajce Nikolov Nick <a href="#" onclick="location.href='mai'+'lto:'+'ope'+'ni'+'g@c'+'om'+'pro'+'.n'+'et'; return false;">openi<span style="display: none;">.nosp@m.</span>g@co<span style="display: none;">.nosp@m.</span>mpro.<span style="display: none;">.nosp@m.</span>net</a> </dd></dl>
<dl class="section copyright"><dt>Copyright</dt><dd>(c)Compro Computer Services, Inc. </dd></dl>
<dl class="section date"><dt>Date</dt><dd>Sun Jan 11 2015 </dd></dl>

</div>
</div>
<a id="af2e9335fefca0c78fd13f65af9fee2b3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af2e9335fefca0c78fd13f65af9fee2b3">&#9670;&nbsp;</a></span>initIdGroup()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void OpenIG::Base::IDPool::initIdGroup </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>group</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>size</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Inits a ID group by a name, base ID and the size of this group. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">The</td><td>name of this ID group. You can have multiple groups identified by a name </td></tr>
    <tr><td class="paramname">The</td><td>base ID. All consequent IDs are from this one and on </td></tr>
    <tr><td class="paramname">The</td><td>size of the vector. If 10, then only 10 different IDs will be available </td></tr>
  </table>
  </dd>
</dl>
<dl class="section author"><dt>Author</dt><dd>Trajce Nikolov Nick <a href="#" onclick="location.href='mai'+'lto:'+'ope'+'ni'+'g@c'+'om'+'pro'+'.n'+'et'; return false;">openi<span style="display: none;">.nosp@m.</span>g@co<span style="display: none;">.nosp@m.</span>mpro.<span style="display: none;">.nosp@m.</span>net</a> </dd></dl>
<dl class="section copyright"><dt>Copyright</dt><dd>(c)Compro Computer Services, Inc. </dd></dl>
<dl class="section date"><dt>Date</dt><dd>Sun Jan 11 2015 </dd></dl>

</div>
</div>
<a id="a01a4e5ea2d56c5d0c4ea2fd019a3cbc6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a01a4e5ea2d56c5d0c4ea2fd019a3cbc6">&#9670;&nbsp;</a></span>instance()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="class_open_i_g_1_1_base_1_1_i_d_pool.html">IDPool</a>* OpenIG::Base::IDPool::instance </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>The singleton. </p>
<dl class="section return"><dt>Returns</dt><dd>The singleton </dd></dl>
<dl class="section author"><dt>Author</dt><dd>Trajce Nikolov Nick <a href="#" onclick="location.href='mai'+'lto:'+'ope'+'ni'+'g@c'+'om'+'pro'+'.n'+'et'; return false;">openi<span style="display: none;">.nosp@m.</span>g@co<span style="display: none;">.nosp@m.</span>mpro.<span style="display: none;">.nosp@m.</span>net</a> </dd></dl>
<dl class="section copyright"><dt>Copyright</dt><dd>(c)Compro Computer Services, Inc. </dd></dl>
<dl class="section date"><dt>Date</dt><dd>Sun Jan 11 2015 </dd></dl>

</div>
</div>
<a id="a4680b1c9d32f9d5363315ea000f4ab17"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4680b1c9d32f9d5363315ea000f4ab17">&#9670;&nbsp;</a></span>setAvailableIds()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void OpenIG::Base::IDPool::setAvailableIds </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>group</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; unsigned int &gt; &amp;&#160;</td>
          <td class="paramname"><em>ids</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets list of IDs to be reused. </p>
<p>Sets list of IDs to be reused. Let explain it through an example. There is a plugin available, see RunwayLights that creates real Lights for a runway model Once this is paged out in a paged visual database, the IDs of these lights can be reused for another runway sitting on another tile </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">The</td><td>ID group name </td></tr>
    <tr><td class="paramname">List</td><td>of available IDs to be reused </td></tr>
  </table>
  </dd>
</dl>
<dl class="section author"><dt>Author</dt><dd>Trajce Nikolov Nick <a href="#" onclick="location.href='mai'+'lto:'+'ope'+'ni'+'g@c'+'om'+'pro'+'.n'+'et'; return false;">openi<span style="display: none;">.nosp@m.</span>g@co<span style="display: none;">.nosp@m.</span>mpro.<span style="display: none;">.nosp@m.</span>net</a> </dd></dl>
<dl class="section copyright"><dt>Copyright</dt><dd>(c)Compro Computer Services, Inc. </dd></dl>
<dl class="section date"><dt>Date</dt><dd>Sun Jan 11 2015 </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>Core-Base/<a class="el" href="_i_d_pool_8h_source.html">IDPool.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed May 16 2018 15:41:11 for OpenIG by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
